clear all;

load('check_balance.mat','data_treat','data_SC');

n=size(data_treat,2)-1;
avg(1:n,1:3)=0.0;
for i=1:n
    avg(i,1)=mean(data_treat(:,i+1));
    avg(i,2)=mean(data_SC(:,i+1));
    v1=var(data_treat(:,i+1));
    v2=var(data_SC(:,i+1));
    N1=length(data_treat(:,i+1));
    N2=length(data_SC(:,i+1));
    
    avg(i,3)=(avg(i,1)-avg(i,2))/sqrt(v1/N1+v2/N2);
end
std1(1:n,1:2)=0.0;
for i=1:n
    std1(i,1)=std(data_treat(:,i+1));
    std1(i,2)=std(data_SC(:,i+1));  
end

result(1:2*n,1:2)=0;
result(1:2:end-1,:)=avg(:,1:2);
result(2:2:end,:)=std1;